package com.example.rabbitmqstudy.service;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.example.rabbitmqstudy.constant.RabbitConstant;

/**
 * @author admin
 * @date 2021/07/14 16:54
 */
@Component
public class RabbitRoutingConsumer {

    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.ROUTING_FIRST_QUEUE_NAME)
    public void routingFirstQueueListener(String context){
        System.out.println("rabbit routing queue first receiver:" + context);
    }
    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.ROUTING_SECOND_QUEUE_NAME)
    public void routingSecondQueueListener(String context){
        System.out.println("rabbit routing queue second receiver:" + context);
    }
    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.ROUTING_THIRD_QUEUE_NAME)
    public void routingThirdQueueListener(String context){
        System.out.println("rabbit pubsub queue third receiver:" + context);
    }

}
